package cn.lingyangwl.agile.auth.assembly;

import cn.lingyangwl.agile.auth.model.AuthLoginLog;
import cn.lingyangwl.agile.auth.model.mq.LoginLogMQ;
import cn.lingyangwl.agile.auth.model.rqrs.AuthUserUpdateReq;
import cn.lingyangwl.agile.model.BaseAssembly;
import cn.lingyangwl.agile.member.model.rqrs.user.MemberUserUpdateReq;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * oauth客户端
 *
 * @author shenguangyang
 */
@Mapper(componentModel = "spring")
public interface AuthAssembly extends BaseAssembly {
  @Mappings({
          @Mapping(source = "message", target = "msg")
  })
  AuthLoginLog toLoginLog(LoginLogMQ.MsgPayload source);

  @Mappings({
          @Mapping(source = "userId", target = "id")
  })
  MemberUserUpdateReq toMemberUserUpdateReq(AuthUserUpdateReq source);
}
